{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import shutil"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part-a.txt\n",
      "part-r-0000-a.txt\n",
      "part-b.txt\n",
      "part-r-0000-b.txt\n",
      "part-c.txt\n",
      "part-r-0000-c.txt\n",
      "Done\n"
     ]
    }
   ],
   "source": [
    "d = './test'\n",
    "for file_name in os.listdir(d):\n",
    "    print(file_name)\n",
    "    new_file_name = file_name.replace('part', 'part-r-0000')\n",
    "    print(new_file_name)\n",
    "    shutil.move(d+'/'+file_name, d+'/'+new_file_name)\n",
    "print('Done')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
